import {
	storeBindingsBehavior
} from 'mobx-miniprogram-bindings'
import base from '@src/store/base'
import {
	dumpFunc
} from '@src/common/dump'
Component({
	/**
	 * 组件的属性列表
	 */
	behaviors: [storeBindingsBehavior],
	storeBindings: [{
		store: base,
		fields: ['themeColor', 'themeTitleColor', 'isiPhoneX']
	}],

	properties: {
		btnType: {
			type: String,
			value: 'anniu'
		},
		moudel: {
			type: Array,
			value: "",
		},
		login: {
			type: Boolean
		}
	},
	options: {
		multipleSlots: true,
		addGlobalClass: true
	},

	/**
	 * 组件的初始数据
	 */
	data: {

	},

	lifetimes: {
		ready() {

		}
	},
	/**
	 * 组件的方法列表
	 */
	methods: {
		dumpPage(e) {
			let {
				dump,
				biz
			} = e.currentTarget.dataset.item
			if (!this.data.login && dump.path != "pages/indexChooseCard/main") {
				this.triggerEvent('login');
				return;
			}
			console.log(dump)
			dumpFunc({...dump, title: this.data.moudel[0].title}, biz)
		}
	}
})
